﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Repositories;
using YunDrug.EmployeeAuthorization;
using YunDrug.Roles;

namespace YunDrug.Employees
{
   public  class UserDomainService:Volo.Abp.Domain.Services.DomainService
    {
        private IRepository<Employee,Guid> user_rep;
        private IRepository<Role,Guid> role_rep;
        private IRepository<EmployeeRole,Guid> userRoles_rep;


        public static async Task<IEnumerable<Employee >> GetUserAll(IRepository<Employee,Guid> user_rep,IRepository<EmployeeRole,Guid> userrole_rep,IRepository<Role,Guid> role_rep)
        {
           var users=await user_rep.GetListAsync();
            //foreach(var user in users)
            //{
            //    var userrole = await userrole_rep.GetListAsync();
            //    var role = await role_rep.GetListAsync();
            //    var _role = from ur in userrole
            //               from ro in role
            //               where ur.RoleId.Equals(ro.Id)
            //               select new UserForRole { RoleCode = ur.UserId, RoleName = ro.Name };
            //    //user.Roles.AddRange(_role);
            //}

            return users.AsEnumerable();
        }

    }
}
